import React, { Component } from 'react';
import { List } from 'antd-mobile'
import { CalendarOutline, FileWrongOutline, ChatCheckOutline, CollectMoneyOutline } from 'antd-mobile-icons'
import { withRouter } from 'react-router-dom'
import { colloct_list } from '../utils/api';
class MyMain extends Component {
    state = {
        cloot_list: []
    }
    Collect() {
        this.props.history.push('/Collect')
    }
    componentDidMount() {
        colloct_list({ params: { userid: localStorage.getItem("userid") } }).then(res => {
            console.log(res);
            this.setState({
                cloot_list: res.data.list
            })
        })
    }
    render() {
        return (
            <div className='mymain'>
                <div className='center'>
                    <div onClick={() => { this.Collect() }}>
                        <span>{this.state.cloot_list.length}</span>
                        <span>收藏</span>
                    </div>
                    <div><span>0</span>
                        <span>积分</span>
                    </div>
                    <div><span>0</span>
                        <span>优惠券</span></div>
                </div>
                <div className='myorder'>
                    <div className='title'>
                        <span className='order'>我的订单</span>
                        <span>查看全部订单 ^ </span>
                    </div>
                    <div className='deal'>
                        <div>
                            <span><CalendarOutline /></span>
                            <span>待付款</span>
                        </div>
                        <div>
                            <span><FileWrongOutline /></span>
                            <span>待发货</span>
                        </div>
                        <div>
                            <span><ChatCheckOutline /></span>
                            <span>已发货</span>
                        </div>
                        <div>
                            <span><CollectMoneyOutline /></span>
                            <span>待评价</span>
                        </div>
                    </div>
                </div>
                <div className='member'>
                    <List>
                        <List.Item onClick={() => { }}>
                            会员中心
                        </List.Item>

                    </List>
                </div>
                <div className='function'>
                    <List>
                        <List.Item onClick={() => { }}>
                            领券中心
                        </List.Item>
                        <List.Item onClick={() => { }}>
                            我的评价
                        </List.Item>
                        <List.Item onClick={() => { }}>
                            收货地址
                        </List.Item>
                        <List.Item onClick={() => { }}>
                            我的客服
                        </List.Item>
                    </List>
                </div>
            </div>
        );
    }
}

export default withRouter(MyMain);